Module 5: Randomized Complete Block Designs (RCBD)

Factorial Treatment Design in a RCBD

Example 5.2: Dental

An anesthesiologist made a comparative study of the effects of acupuncture and codeine on postoperative dental pain in male subjects. The four treatment combinations were as follows:

  • Placebo treatment (a sugar pill and two inactive acupuncture points)
  • Codeine treatment (a codeine pill and two inactive acupuncture points)
  • Acupuncture only (a sugar pill and two active acupuncture points)
  • Codeine and acupuncture (a codeine pill and two active acupuncture points)

Thirty-two subjects were grouped into 8 blocks of size 4 according to an initial evaluation of their pain tolerance. The subjects in each block were then randomly assigned to the four treatment combinations. The pain relief scores were obtained for all subjects two hours after dental treatment (data were collected on a double-blind basis). The higher the pain relief score the more effective the treatment.

Example 5.2 Blueprint

  1. Why do you think pain tolerance was used as a blocking variable?

Example 5.2: Study Structure

Treatment Structure

A 2x2 full factorial between Drug (sugar/codeine) and Acupuncture (active/inactive) for a total of t = 4 treatment combinations.

Experimental Structure

Drug and acupuncture treatment combinations were randomly assigned to subjects (e.u.) in a RCBD with r = 8 replications (blocks) where pain tolerance is the blocking factor (block size = 4). We measured the pain releif scores on each subject (m.u.) for a total N = 32 subjects.

Statistical Effects Model

\[y_{ijk} = \mu + \alpha_i + \beta_j + \alpha\beta_{ij} + \rho_k + \epsilon_{ijk} \text{ with } \epsilon_{ijk} \text{iid} \sim N(0,\sigma^2)\] for \(i = 1, 2; j = 1, 2; k = 1, 2, ..., 8\)

Where:

  • \(y_{ijk}\) is the pain relief score from the subject in the \(k^{th}\) pain tolerance block receiving the \(i^{th}\) level of drug and the \(j^{th}\) level acupuncture
  • \(\mu\) is the overall mean pain relief score
  • \(\alpha_i\) is the effect of the \(i^{th}\) level of drug
  • \(\beta_j\) is the effect of the \(j^{th}\) level of acupuncture
  • \(\alpha\beta_{ij}\) is the interaction effect between the \(i^{th}\)level of drug and the \(j^{th}\) level of acupuncture
  • \(\rho_k\) is the effect of the kth block
  • \(\epsilon_{ijk}\) is the experimental error associated with the subject from the \(k^{th}\) pain tolerance block receiving the \(i^{th}\) level of drug and the \(j^{th}\) level of acupuncture

ANOVA Table

Source of Variation DF SS MS F
Blocks r-1 SSBlk MSBlk MSBlk/MSE
A a-1 SSA MSA MSA/MSE
B b-1 SSB MSB MSB/MSE
AxB (a-1)(b-1) SSAB MSAB MSAB/MSE
Block x AB \(\rightarrow\) error (r-1)(ab-1) SSE MSE
Total (N = rab) N-1

Skeleton ANOVA

Source of Variation DF

Example 5.2: The Data

Warning

Ensure “block” is a factor/character!

library(tidyverse)
dental_data <- read_csv("data/05_dental_data.csv") |> 
  mutate(pain_tol = as.factor(pain_tol))
head(dental_data, n = 8)
# A tibble: 8 × 4
  pain_tol drug    acupuncture score
  <fct>    <chr>   <chr>       <dbl>
1 1        sugar   active        0.6
2 1        codeine inactive      0.5
3 1        sugar   inactive      0  
4 1        codeine active        1.2
5 2        codeine inactive      0.6
6 2        sugar   active        0.7
7 2        sugar   inactive      0.3
8 2        codeine active        1.3

R: Analysis

options(contrasts = c("contr.sum", "contr.poly"))
# score ~ drug*acupuncture + pain_tol
dental_mod <- lm(score ~ pain_tol + drug + acupuncture + drug:acupuncture, 
                 data = dental_data)
anova(dental_mod)
Analysis of Variance Table

Response: score
                 Df Sum Sq Mean Sq  F value    Pr(>F)    
pain_tol          7 5.5988  0.7998  55.2963 4.126e-12 ***
drug              1 2.3113  2.3113 159.7901 2.773e-11 ***
acupuncture       1 3.3800  3.3800 233.6790 7.465e-13 ***
drug:acupuncture  1 0.0450  0.0450   3.1111    0.0923 .  
Residuals        21 0.3038  0.0145                       
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
summary(dental_mod)

Call:
lm(formula = score ~ pain_tol + drug + acupuncture + drug:acupuncture, 
    data = dental_data)

Residuals:
     Min       1Q   Median       3Q      Max 
-0.18125 -0.06250  0.00000  0.04688  0.24375 

Coefficients:
                   Estimate Std. Error t value Pr(>|t|)    
(Intercept)         1.15625    0.02126  54.385  < 2e-16 ***
pain_tol1          -0.58125    0.05625 -10.333 1.09e-09 ***
pain_tol2          -0.43125    0.05625  -7.667 1.62e-07 ***
pain_tol3          -0.25625    0.05625  -4.556 0.000172 ***
pain_tol4          -0.28125    0.05625  -5.000 5.99e-05 ***
pain_tol5           0.09375    0.05625   1.667 0.110427    
pain_tol6           0.39375    0.05625   7.000 6.53e-07 ***
pain_tol7           0.49375    0.05625   8.778 1.80e-08 ***
drug1               0.26875    0.02126  12.641 2.77e-11 ***
acupuncture1        0.32500    0.02126  15.287 7.47e-13 ***
drug1:acupuncture1  0.03750    0.02126   1.764 0.092304 .  
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Residual standard error: 0.1203 on 21 degrees of freedom
Multiple R-squared:  0.9739,    Adjusted R-squared:  0.9615 
F-statistic: 78.37 on 10 and 21 DF,  p-value: 2.521e-14

JMP: Analysis

Analyze > Fit Model

Check Model Assumptions \(\epsilon_{ijk} \text{iid} \sim N(0\sigma^2)\)

par(mfrow = c(2,2))
plot(dental_mod)

Factorial flow chart

Where should we proceed with our analysis?

Analysis of Variance Table

Response: score
                 Df Sum Sq Mean Sq  F value    Pr(>F)    
pain_tol          7 5.5988  0.7998  55.2963 4.126e-12 ***
drug              1 2.3113  2.3113 159.7901 2.773e-11 ***
acupuncture       1 3.3800  3.3800 233.6790 7.465e-13 ***
drug:acupuncture  1 0.0450  0.0450   3.1111    0.0923 .  
Residuals        21 0.3038  0.0145                       
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Main Effect of Drug

 contrast        estimate     SE df lower.CL upper.CL t.ratio p.value
 codeine - sugar    0.537 0.0425 21    0.449    0.626  12.641 <0.0001

Results are averaged over the levels of: pain_tol, acupuncture 
Confidence level used: 0.95 

Codeine results in the highest mean pain relief at 1.42 (s.e. 0.03). This is, on average, 0.53 points more relief than the sugar pill (t = 12.64; df = 21; p < 0.0001).

Main Effect of Acupuncture

 contrast          estimate     SE df lower.CL upper.CL t.ratio p.value
 active - inactive     0.65 0.0425 21    0.562    0.738  15.287 <0.0001

Results are averaged over the levels of: pain_tol, drug 
Confidence level used: 0.95 

Active acupuncture results in the highest mean pain releif at 1.48 (s.e. = 0.03). This is, on average, 0.65 points higher than inactive acupuncture (t = 15.29; df = 21; p < 0.0001).